﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using Karbel;
 
using Ersur.DevTeam;

namespace Ersur
{
    public partial class Clear : DevExpress.XtraEditors.XtraForm
    {
       
        public Clear()
        {
            InitializeComponent();
        }

        private void txtPassword_TextChanged(object sender, EventArgs e)
        {
            if (txtPassword.Text == "11335577")
                btnClear.Enabled = true;
            else
                btnClear.Enabled = false;
        }

        private void btnClear_Click(object sender, EventArgs e)
        {
            try
            {
                ErsurServices.ErsurServicesSoapClient service = new ErsurServices.ErsurServicesSoapClient();
                service.ClearTerminal("ers", Settings.TerminalNo);
                Data.ExecuteDataSet("ClearDB");
                this.DialogResult = DialogResult.OK;
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("Could not connect to web service. Check the internet connection!" + " [" + ex.ToString() + "]");
            }
        }
    }
}